package com.dataconver.sync;

/**
 * 同步结果
 */
public class SyncResult {
    private String tableName;
    private boolean success;
    private String errorMessage;
    private long startTime;
    private long endTime;
    private int totalRows;
    private int processedRows;
    private int updatedRows;    // 更新的行数
    private int insertedRows;   // 插入的行数
    private int deletedRows;    // 删除的行数
    
    public SyncResult() {
        this.startTime = System.currentTimeMillis();
    }
    
    // Getters and Setters
    public String getTableName() { return tableName; }
    public void setTableName(String tableName) { this.tableName = tableName; }
    
    public boolean isSuccess() { return success; }
    public void setSuccess(boolean success) { this.success = success; }
    
    public String getErrorMessage() { return errorMessage; }
    public void setErrorMessage(String errorMessage) { this.errorMessage = errorMessage; }
    
    public long getStartTime() { return startTime; }
    public void setStartTime(long startTime) { this.startTime = startTime; }
    
    public long getEndTime() { return endTime; }
    public void setEndTime(long endTime) { this.endTime = endTime; }
    
    public int getTotalRows() { return totalRows; }
    public void setTotalRows(int totalRows) { this.totalRows = totalRows; }
    
    public int getProcessedRows() { return processedRows; }
    public void setProcessedRows(int processedRows) { this.processedRows = processedRows; }
    
    public int getUpdatedRows() { return updatedRows; }
    public void setUpdatedRows(int updatedRows) { this.updatedRows = updatedRows; }
    
    public int getInsertedRows() { return insertedRows; }
    public void setInsertedRows(int insertedRows) { this.insertedRows = insertedRows; }
    
    public int getDeletedRows() { return deletedRows; }
    public void setDeletedRows(int deletedRows) { this.deletedRows = deletedRows; }
    
    /**
     * 获取执行时间（毫秒）
     */
    public long getExecutionTime() {
        return endTime - startTime;
    }
}
